import 'package:flutter/material.dart';

/// 2022年更新  适配 flutter 3.0

class ActionClipPage extends StatefulWidget {
  const ActionClipPage({super.key});

  @override
  State createState() => ActionClipPageState();
}

class ActionClipPageState extends State<ActionClipPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //页面角手架
      appBar: AppBar(title: const Text("ActionChip")), //标题
      body: Center(
        //页面居中
        child: buildActionChip(),
      ),
    );
  }

  ActionChip buildActionChip() {
    return ActionChip(
      avatar: CircleAvatar(
        backgroundColor: Colors.grey.shade800,
        child: const Text('AB'),
      ),
      label: const Text('Aaron Burr'),
      onPressed: () {
        print('If you stand for nothing, Burr, what’ll you fall for?');
      },
    );
  }
}
